<style scoped>
    .el-form--inline .el-form-item{margin-right:10px;}
    .el-table__body-wrapper{max-height:142px;overflow-y:auto;}
</style>

<template>
    <div class="inspection-level-setting-page">
        <el-form :inline="true" :model="formInline" class="demo-form-inline" style="border-bottom:1px solid #ccc;">
            <!--法人名称-->
            <el-form-item :label="nowLangue.legalName" class="selectMB10">
                <el-select size="mini" clearable v-model="formInline.status" :placeholder="nowLangue.pleaseSelect">
                    <el-option v-for="(status,index) in statusList" :key="index" :label="status.label" :value="status.value"></el-option>
                </el-select>
            </el-form-item>
            <!--检验水平编码-->
            <el-form-item :label="nowLangue.inspectionLevelCoding" class="selectMB10">
                <el-input size="mini" v-model="formInline.materialName" :placeholder="nowLangue.pleaseImport+nowLangue.inspectionLevelCoding"></el-input>
            </el-form-item>
            <!--检验水平名称-->
            <el-form-item :label="nowLangue.inspectionLevelName" class="selectMB10">
                <el-select size="mini" clearable v-model="formInline.status" :placeholder="nowLangue.pleaseSelect">
                    <el-option v-for="(status,index) in statusList" :key="index" :label="status.label" :value="status.value"></el-option>
                </el-select>
            </el-form-item>
            <!--状态-->
            <el-form-item :label="nowLangue.status" class="selectMB10">
                <el-select size="mini" clearable v-model="formInline.status" :placeholder="nowLangue.pleaseSelect">
                    <el-option v-for="(status,index) in statusList" :key="index" :label="status.label" :value="status.value"></el-option>
                </el-select>
            </el-form-item>
            <!--检验标准名称-->
            <el-form-item :label="nowLangue.inspectionStandardName" class="selectMB10">
                <el-input size="mini" v-model="formInline.materialName" :placeholder="nowLangue.pleaseImport+nowLangue.inspectionStandardName"></el-input>
            </el-form-item>
            <!--创建时间-->
            <el-form-item :label="nowLangue.creationTime" class="selectMB10">
                <el-date-picker size="mini" v-model="formInline.startCreateTime" :editable="false" type="date" :placeholder="nowLangue.pleaseSelect" @change="selectedCreateTimeBegin" style="width:110px"></el-date-picker>
                <span v-text="nowLangue.to"></span>
                <el-date-picker size="mini" v-model="formInline.endCreateTime" :editable="false" type="date" :placeholder="nowLangue.pleaseSelect" @change="selectedCreateTimeEnd" style="width:110px"></el-date-picker>
            </el-form-item>
            <el-form-item class="selectMB10">
                <el-button class="bolder outsideBtnBS selectAll" :disabled="selectDisabled" size="mini" type="danger" @click="queryClick()" v-text="nowLangue.query"></el-button>
            </el-form-item>
        </el-form>
        <!--表格-->
        <label class="default-label" v-text="nowLangue.inspectionLevelDetails"></label>
        <el-button class="bolder outsideBtnBS" :disabled="addDisabled" size="mini" type="danger" @click="handleAdd" v-text="nowLangue.create"></el-button>
        <!--导入-->
        <el-button class="bolder outsideBtnBS" @click="leadingIn" size="mini" type="danger" v-text="nowLangue.leadingIn"></el-button>
        <!--导出-->
        <el-button class="bolder outsideBtnBS" @click="leadingOut" size="mini" type="danger" v-text="nowLangue.leadingOut"></el-button>
        <el-table :data="autoExamData" border style="width: 100%;" v-loading.body="loading" :element-loading-text="nowLangue.loadDesperately">
            <el-table-column type="index" header-align="center" align="center" :label="nowLangue.sequence" width="40"></el-table-column>
            <!--操作-->
            <el-table-column :label="nowLangue.operate" header-align="center" align="center" width="120">
                <template scope="scope">
                    <button class="operationItem bolder" :disabled="forbiddenDisabled" v-if="scope.row.status" @click="handleStatus(scope.$index,scope.row)" v-text="nowLangue.forbidden"></button>
                    <button class="operationItem bolder" :disabled="enableDisabled" v-else @click="handleStatus(scope.$index,scope.row)" v-text="nowLangue.enable"></button>
                    <button class="operationItem disabled bolder" v-if="scope.row.status" v-text="nowLangue.update"></button>
                    <button class="operationItem bolder" v-else @click="handleUpdate(scope.$index,scope.row)" v-text="nowLangue.update"></button>
                    <button class="operationItem bolder" @click="handleSee(scope.$index,scope.row)" v-text="nowLangue.see"></button>
                </template>
            </el-table-column>
            <!--检验水平编码-->
            <el-table-column prop="" :label="nowLangue.inspectionLevelCoding" header-align="center" show-overflow-tooltip></el-table-column>
            <!--检验水平名称-->
            <el-table-column prop="" :label="nowLangue.inspectionLevelName" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--适用检验范围-->
            <el-table-column prop="" :label="nowLangue.applicableInspectionRange" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--检验标准-->
            <el-table-column prop="" :label="nowLangue.inspectionStandard" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--法人名称-->
            <el-table-column prop="" :label="nowLangue.legalName" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--状态-->
            <el-table-column prop="" :label="nowLangue.status" header-align="center" width="80" show-overflow-tooltip></el-table-column>
            <!--创建人-->
            <el-table-column prop="" :label="nowLangue.founder" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--创建时间-->
            <el-table-column prop="" :label="nowLangue.creationTime" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--修改人-->
            <el-table-column prop="" :label="nowLangue.modifier" header-align="center"  show-overflow-tooltip></el-table-column>
            <!--最近修改时间-->
            <el-table-column prop="" :label="nowLangue.latestModificationTime" header-align="center"  show-overflow-tooltip></el-table-column>
        </el-table>
        <el-pagination v-if="isPaging"  @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage3" :current-page="pageIndex"  :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :page-count="totalPage" :total="totalNumber"></el-pagination>
        <!--新增弹窗-->
        <el-dialog :title="nowLangue.create+nowLangue.inspectionLevelName" :visible.sync="dialogAddVisible" size="small" :lock-scroll="false">
            <el-form :inline="true" :model="addAutoExamForm" class="demo-form-inline label-minW95" style="border-bottom:1px solid #ccc;" ref="addAutoExamForm">
                <!--法人名称-->
                <el-form-item :label="nowLangue.legalName" prop="subClassCode" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-select size="mini" clearable v-model="addAutoExamForm.status" :placeholder="nowLangue.pleaseSelect">
                        <el-option v-for="(status,index) in statusList" :key="index" :label="status.label" :value="status.value"></el-option>
                    </el-select>
                </el-form-item>
                <!--检验标准名称-->
                <el-form-item :label="nowLangue.inspectionStandardName" prop="code" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-input v-model="addAutoExamForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--检验水平编码-->
                <el-form-item :label="nowLangue.inspectionLevelCoding" prop="code" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-input v-model="addAutoExamForm.code" :placeholder="nowLangue.pleaseImport"></el-input>
                </el-form-item>
                <!--检验水平名称-->
                <el-form-item :label="nowLangue.inspectionLevelName" prop="code" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-select size="mini" clearable v-model="formInline.status" :placeholder="nowLangue.pleaseSelect">
                        <el-option v-for="(status,index) in statusList" :key="index" :label="status.label" :value="status.value"></el-option>
                    </el-select>
                </el-form-item>
                <!--适用检查范围-->
                <el-form-item :label="nowLangue.applicableInspectionRange" prop="code" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-checkbox label="电性能检验"></el-checkbox>
                    <el-checkbox label="外观检验"></el-checkbox>
                </el-form-item>
            </el-form>
            <!--表格-->
            <label class="default-label" v-text="nowLangue.inspectionLevelDetails"></label>
            <el-button class="bolder outsideBtnBS" size="mini" type="danger" @click="handleAddAdd" v-text="nowLangue.create"></el-button>
            <el-table :data="addTableData" border style="width: 100%;" v-loading.body="loading" :element-loading-text="nowLangue.loadDesperately">
                <el-table-column type="index" header-align="center" align="center" :label="nowLangue.sequence" width="40"></el-table-column>
                <!--操作-->
                <el-table-column :label="nowLangue.operate" header-align="center" align="center" width="100">
                    <template scope="scope">
                        <button class="operationItem bolder" @click="handleUpdateAdd(scope.$index,scope.row)" v-text="nowLangue.update"></button>
                        <button class="operationItem bolder" @click="handleDelAdd(scope.$index,addTableData)" v-text="nowLangue.delete"></button>
                    </template>
                </el-table-column>
                <!--起始数量-->
                <el-table-column prop="" :label="nowLangue.initialQuantity" header-align="center"  show-overflow-tooltip>
                    <template scope="scope">
                        <el-input size="mini" v-model.number="scope.row.initialQuantity" :placeholder="nowLangue.pleaseImport" :disabled="scope.row.addRowsDisabled"></el-input>
                    </template>
                </el-table-column>
                <!--截止数量-->
                <el-table-column prop="" :label="nowLangue.cutOffNumber" header-align="center"  show-overflow-tooltip>
                    <template scope="scope">
                        <el-input size="mini" v-model.number="scope.row.cutOffNumber" :placeholder="nowLangue.pleaseImport" :disabled="scope.row.addRowsDisabled"></el-input>
                    </template>
                </el-table-column>
                <!--检验数量-->
                <el-table-column prop="" :label="nowLangue.inspectionQuantity" header-align="center"  show-overflow-tooltip>
                    <template scope="scope">
                        <el-input size="mini" v-model.number="scope.row.inspectionQuantity" :placeholder="nowLangue.pleaseImport" :disabled="scope.row.addRowsDisabled"></el-input>
                    </template>
                </el-table-column>
            </el-table>
            <div slot="footer" class="dialog-footer">
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" v-text="nowLangue.sure"></el-button>
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" v-text="nowLangue.cancel" @click="dialogAddVisible=false"></el-button>
            </div>
        </el-dialog>
        <!--修改弹窗-->
        <el-dialog :title="nowLangue.update+nowLangue.inspectionLevelName" :visible.sync="dialogUpdateVisible" size="small" :lock-scroll="false">
            <el-form :inline="true" :model="updateAutoExamForm" class="demo-form-inline label-minW95" style="border-bottom:1px solid #ccc;" ref="updateAutoExamForm">
                <!--法人名称-->
                <el-form-item :label="nowLangue.legalName" prop="subClassCode" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-select size="mini" clearable v-model="updateAutoExamForm.status" :placeholder="nowLangue.pleaseSelect">
                        <el-option v-for="(status,index) in statusList" :key="index" :label="status.label" :value="status.value"></el-option>
                    </el-select>
                </el-form-item>
                <!--检验水平编码-->
                <el-form-item :label="nowLangue.inspectionLevelCoding" prop="code" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-input v-model="updateAutoExamForm.code" disabled></el-input>
                </el-form-item>
                <!--检验水平名称-->
                <el-form-item :label="nowLangue.inspectionLevelName" prop="code" :rules="[{ required: true, message: nowLangue.pleaseImport},{ max: 50, message: nowLangue.lessThan50}]">
                    <el-select size="mini" clearable v-model="formInline.status" :placeholder="nowLangue.pleaseSelect">
                        <el-option v-for="(status,index) in statusList" :key="index" :label="status.label" :value="status.value"></el-option>
                    </el-select>
                </el-form-item>
                <!--适用检查范围-->
                <el-form-item :label="nowLangue.applicableInspectionRange" prop="code" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-checkbox label="电性检验"></el-checkbox>
                    <el-checkbox label="外观检验"></el-checkbox>
                </el-form-item>
            </el-form>
            <!--表格-->
            <label class="default-label" v-text="nowLangue.inspectionLevelDetails"></label>
            <el-button class="bolder outsideBtnBS" size="mini" type="danger" @click="handleAddUpdate" v-text="nowLangue.create"></el-button>
            <el-table :data="updateTableData" border style="width: 100%;" v-loading.body="loading" :element-loading-text="nowLangue.loadDesperately">
                <el-table-column type="index" header-align="center" align="center" :label="nowLangue.sequence" width="40"></el-table-column>
                <!--操作-->
                <el-table-column :label="nowLangue.operate" header-align="center" align="center" width="100">
                    <template scope="scope">
                        <button class="operationItem bolder" @click="handleUUpdate(scope.$index,scope.row)" v-text="nowLangue.update"></button>
                        <button class="operationItem bolder" @click="handleDelUpdate(scope.$index,updateTableData)" v-text="nowLangue.delete"></button>
                    </template>
                </el-table-column>
                <!--起始数量-->
                <el-table-column prop="" :label="nowLangue.initialQuantity" header-align="center"  show-overflow-tooltip>
                    <template scope="scope">
                        <el-input size="mini" v-model.number="scope.row.initialQuantity" :placeholder="nowLangue.pleaseImport" :disabled="scope.row.updateRowsDisabled"></el-input>
                    </template>
                </el-table-column>
                <!--截止数量-->
                <el-table-column prop="" :label="nowLangue.cutOffNumber" header-align="center"  show-overflow-tooltip>
                    <template scope="scope">
                        <el-input size="mini" v-model.number="scope.row.cutOffNumber" :placeholder="nowLangue.pleaseImport" :disabled="scope.row.updateRowsDisabled"></el-input>
                    </template>
                </el-table-column>
                <!--检验数量-->
                <el-table-column prop="" :label="nowLangue.inspectionQuantity" header-align="center"  show-overflow-tooltip>
                    <template scope="scope">
                        <el-input size="mini" v-model.number="scope.row.inspectionQuantity" :placeholder="nowLangue.pleaseImport" :disabled="scope.row.updateRowsDisabled"></el-input>
                    </template>
                </el-table-column>
            </el-table>
            <div slot="footer" class="dialog-footer">
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" v-text="nowLangue.sure"></el-button>
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" v-text="nowLangue.cancel" @click="dialogUpdateVisible=false"></el-button>
            </div>
        </el-dialog>
        <!--查看弹窗-->
        <el-dialog :title="nowLangue.see+nowLangue.inspectionLevelName" :visible.sync="dialogSeeVisible" size="small" :lock-scroll="false">
            <el-form :inline="true" :model="updateAutoExamForm" class="demo-form-inline label-minW95" style="border-bottom:1px solid #ccc;" ref="updateAutoExamForm">
                <!--法人名称-->
                <el-form-item :label="nowLangue.legalName" prop="subClassCode" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-input size="mini" v-model="updateAutoExamForm.code" disabled></el-input>
                </el-form-item>
                <!--检验水平编码-->
                <el-form-item :label="nowLangue.inspectionLevelCoding" prop="code" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-input size="mini" v-model="updateAutoExamForm.code" disabled></el-input>
                </el-form-item>
                <!--检验水平名称-->
                <el-form-item :label="nowLangue.inspectionLevelName" prop="code" :rules="[{ required: true, message: nowLangue.pleaseImport},{ max: 50, message: nowLangue.lessThan50}]">
                    <el-select size="mini" clearable v-model="formInline.status" :placeholder="nowLangue.pleaseSelect">
                        <el-option v-for="(status,index) in statusList" :key="index" :label="status.label" :value="status.value"></el-option>
                    </el-select>
                </el-form-item>
                <!--适用检查范围-->
                <el-form-item :label="nowLangue.applicableInspectionRange" prop="code" :rules="[{ required: true, message: nowLangue.pleaseImport}]">
                    <el-checkbox size="mini" label="电性检验"  disabled></el-checkbox>
                    <el-checkbox size="mini" label="外观检验"  disabled></el-checkbox>
                </el-form-item>
            </el-form>
            <!--表格-->
            <label class="default-label" v-text="nowLangue.inspectionLevelDetails"></label>
            <el-table :data="seeTableData" border style="width: 100%;" v-loading.body="loading" :element-loading-text="nowLangue.loadDesperately">
                <el-table-column type="index" header-align="center" align="center" :label="nowLangue.sequence" width="40"></el-table-column>
                <!--起始数量-->
                <el-table-column prop="initialQuantity" :label="nowLangue.initialQuantity" header-align="center"  show-overflow-tooltip></el-table-column>
                <!--截止数量-->
                <el-table-column prop="cutOffNumber" :label="nowLangue.cutOffNumber" header-align="center"  show-overflow-tooltip></el-table-column>
                <!--检验数量-->
                <el-table-column prop="inspectionQuantity" :label="nowLangue.inspectionQuantity" header-align="center"  show-overflow-tooltip></el-table-column>
            </el-table>
            <div slot="footer" class="dialog-footer">
                <el-button class="bolder outsideBtnBS" size="mini" type="danger" v-text="nowLangue.cancel" @click="dialogSeeVisible=false"></el-button>
            </div>
        </el-dialog>
        <!--导入弹窗-->
        <el-dialog :title="nowLangue.leadingIn+nowLangue.inspectionLevel" id="importFile" :visible.sync="importFileVisible" size="tiny"  :lock-scroll="false">
            <el-upload class="upload-demo"  :action="action" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" :on-preview="handlePreview" :on-remove="handleRemove" :file-list="fileList" :before-upload="beforeAvatarUpload" :on-success="handleAvatarSuccess">
                <!--点击上传 -->
                <el-button size="mini" type="danger" v-text="nowLangue.clickUpload"></el-button>
                <!-- 只能上传excel文件-->
                <div slot="tip" class="el-upload__tip" v-text="nowLangue.uploadTip"></div>
            </el-upload>
        </el-dialog>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                nowLangue:{},
                languageScoped:{
                    zh:{
                        "pleaseSelect":"请选择",
                        "pleaseImport":"请输入",
                        "query":"查询",
                        "loadDesperately":"拼命加载中",
                        "sequence":"序",
                        "operate":"操作",
                        "update":"修改",
                        "see":"查看",
                        "forbidden":"禁用",
                        "enable":"启用",
                        "sure":"确定",
                        "cancel":"取消",
                        "create":"新增",
                        "legalName":"法人名称", 
                        "inspectionLevel":"检验水平",  
                        "inspectionLevelCoding":"检验水平编码",
                        "inspectionLevelName":"检验水平名称",
                        "inspectionStandardName":"检验标准名称",
                        "status":"状态",
                        "inspectionLevelDetails":"检验水平明细",
                        "applicableInspectionRange":"适用检验范围",
                        "inspectionStandard":"检验标准",
                        "founder":"创建人",
                        "creationTime":"创建时间",
                        "modifier":"修改人",
                        "latestModificationTime":"最近修改时间",
                        "lessThan50":"最多不能超过50个字符",
                        "to":"至",
                        "leadingIn":"导入",
                        "leadingOut":"导出",
                        "clickUpload":"点击上传",
                        "uploadTip":"只能上传excel文件",
                        "initialQuantity":"起始数量",
                        "cutOffNumber":"截止数量",
                        "inspectionQuantity":"检验数量",
                        "delete":"删除"
                    },
                    en:{
                        "pleaseSelect":"pleaseSelect",
                        "pleaseImport":"pleaseImport",
                        "query":"query",
                        "loadDesperately":"loadDesperately",
                        "sequence":"sequence",
                        "operate":"operate",
                        "update":"update",
                        "see":"see",
                        "forbidden":"forbidden",
                        "enable":"enable",
                        "sure":"sure",
                        "cancel":"cancel",
                        "create":"create",
                        "legalName":"legalName",
                        "inspectionLevel":"inspectionLevel",
                        "inspectionLevelCoding":"inspectionLevelCoding",
                        "inspectionLevelName":"inspectionLevelName",
                        "inspectionStandardName":"inspectionStandardName",
                        "status":"status",
                        "inspectionLevelDetails":"inspectionLevelDetails",
                        "applicableInspectionRange":"applicableInspectionRange",
                        "inspectionStandard":"inspectionStandard",
                        "founder":"founder",
                        "creationTime":"creationTime",
                        "modifier":"modifier",
                        "latestModificationTime":"latestModificationTime",
                        "lessThan50":"At most not more than 50 characters",
                        "to":"to",
                        "leadingIn":"leadingIn",
                        "leadingOut":"leadingOut",
                        "clickUpload":"clickUpload",
                        "uploadTip":"uploadTip",
                        "initialQuantity":"initialQuantity",
                        "cutOffNumber":"cutOffNumber",
                        "inspectionQuantity":"inspectionQuantity",
                        "delete":"delete"
                    }
                },
                statusList:[],   //状态下拉列表
                // 查询表单
                formInline:{
                    startCreateTime:"",
                    endCreateTime:""
                },
                autoExamData:[{
                    name:"aaa"
                }],
                /*新增*/
                dialogAddVisible:false,//新建弹窗
                addAutoExamForm:{},//新建查询表单

                /*修改*/
                dialogUpdateVisible:false,//修改弹窗
                dialogSeeVisible:false,  //查看弹窗
                updateAutoExamForm:{},//新建查询表单


                //按钮禁用
                selectDisabled:false,
                addDisabled:false,
                leadInDisabled:false,
                leadOutDisabled:false,
                enableDisabled:false,
                forbiddenDisabled:false,

                loading:false,
                isPaging:true,    //是否显示分页
                pageIndex:1,    //当前页（必传）
                pageSize :10,   //每页多少条
                currentPage:1,    //当前显示3页
                currentPage3:3,
                totalNumber: 1,     //总条数
                totalPage:1,    //总页数
                addTableData:[],
                updateTableData:[
                    {
                        initialQuantity:1,
                        cutOffNumber:2,
                        inspectionQuantity:3,
                        updateRowsDisabled:true
                    },
                    {
                        initialQuantity:2,
                        cutOffNumber:3,
                        inspectionQuantity:4,
                        updateRowsDisabled:true
                    },
                    {
                        initialQuantity:3,
                        cutOffNumber:4,
                        inspectionQuantity:5,
                        updateRowsDisabled:true
                    },
                    {
                        initialQuantity:4,
                        cutOffNumber:5,
                        inspectionQuantity:6,
                        updateRowsDisabled:true
                    },
                    {
                        initialQuantity:5,
                        cutOffNumber:6,
                        inspectionQuantity:7,
                        updateRowsDisabled:true
                    }
                ],
                seeTableData:[
                    {
                        initialQuantity:5,
                        cutOffNumber:6,
                        inspectionQuantity:7
                    }
                ],
                importFileVisible:false,
                fileList:[],
                action:""
            };
        },
        created:function(){
            this.languageType=="zh"?this.nowLangue=this.languageScoped.zh:this.nowLangue=this.languageScoped.en;
        },
        computed:{
            languageType(){
                return this.$store.state.languageType;
            }
        },
        watch:{
            languageType(){
                this.languageType=="zh"?this.nowLangue=this.languageScoped.zh:this.nowLangue=this.languageScoped.en;
            }
        },
        //进入页面立即运行此方法
        mounted: function () {
            var _this = this;
            _this.$store.commit('currentActive', 'AautoExam');
        },
        methods:{
            selectedCreateTimeBegin(val){

            },
            selectedCreateTimeEnd(val){

            },
            //查询列表
            queryClick(){
                /*var _this=this;
                 _this.loading=true;
                 var urlAddress="";
                 if(this.isClickBySelect){
                     urlAddress="projectSubstitute/queryMaterialByPage";
                 }else{
                     urlAddress="projectSubstitute/queryIncreasementMaterialByPage";
                 }
                 var tmp={
                     productLineId:_this.formInline.productLineId,
                     legalPersonCode:_this.formInline.legalPersonCode,
                     startCreateTime:_this.formInline.startCreateTime,
                     endCreateTime:_this.formInline.endCreateTime,
                     materialCode:_this.formInline.materialCode,
                     materialName:_this.formInline.materialName,
                     status:_this.formInline.status,
                     pageIndex:_this.pageIndex,
                     pageSize:_this.pageSize
                 };
                 $.ajax({
                     type: 'POST',
                     url: _this.metadata_service+urlAddress,
                     cache: false,
                     data:JSON.stringify(tmp),
                     dataType:'JSON',
                     contentType: "application/json;charset=utf-8",
                     success: function (data) {
                         if (data.success) {
                             _this.loading=false;
                             _this.isPaging=true;
                             _this.totalPage=data.data.totalPage;
                             _this.totalNumber=data.data.totalNumber;
                             _this.productData=data.data.dataList;
                         }else{
                             _this.loading=false;
                            _this.common.errorTip(data.errorMessage)
                         }
                     }
                 });*/
            },
            //导入
            leadingIn(){
                this.importFileVisible=true;
                this.fileList=[];
            },
            //上传文件之前的钩子
            beforeAvatarUpload(file) {
                const isExcel2007 = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
                const isExcel2003 = file.type === 'application/vnd.ms-excel';
                if (!isExcel2007 && !isExcel2003) {
                    this.$message.error('只能上传excel文件!');
                }
                return isExcel2007 || isExcel2003 ;
            },
            // 文件上传成功时的钩子
            handleAvatarSuccess(data, file) {
                // var _this=this;
                // if(data.success){
                //     var successMessage=_this.languageType=="zh"?'上传成功！':'Upload successfully!';
                //     _this.common.successTip(successMessage);
                //     _this.importFileVisible = false;
                //     //上传成功刷新页面
                //     _this.queryGReplacement();
                // }else if(data.errorCode=="substituteForm.add.exist.substitute.relation"){
                //     var errorRelation="";
                //     for(var i=0;i<data.hint.length;i++){
                //         errorRelation+=data.hint[i].materialCode+" -> " + data.hint[i].subMaterialCode +" "+data.hint[i].reqSubTypeName +'\n';
                //     }
                //     _this.common.errorTip(data.errorMessage+'\n'+errorRelation);
                //     _this.fileList=[];
                // }else if(data.errorCode=="substituteForm.add.exist.same.item"){
                //     var errorItem="";
                //     for(var i=0;i<data.errorArgs.length;i++){
                //         errorItem+=data.errorArgs[i]+",";
                //     }
                //     _this.common.errorTip(errorItem+ " " + data.errorMessage);
                //     _this.fileList=[];
                // }else if(data.errorCode=="substituteForm.add.exist.self2self"){
                //     var errorSelf="";
                //     for(var i=0;i<data.hint.length;i++){
                //         errorSelf+=data.hint[i].materialCode+",";
                //     }
                //     _this.common.errorTip(errorSelf+ " " + data.errorMessage);
                //     _this.fileList=[];
                // }else{
                //     _this.common.errorTip(data.errorMessage);
                //     _this.fileList=[];
                // }
            },
            handleRemove(file, fileList) {
                console.log(file, fileList);
            },
            handlePreview(file) {
                console.log(file);
            },
            // 导出
            leadingOut(){

            },
            // 操作启用禁用
            handleStatus(index, row){
                /*var _this=this;
                if(row.status){
                    row.status = false;
                }else{
                    row.status = true;
                }
                var tmp={id: row.id,status: row.status};
                $.ajax({
                    type: 'POST',
                    url: _this.metadata_service+"materialProperty/updateStatus",
                    cache: false,
                    data:JSON.stringify(tmp),
                    dataType:'JSON',
                    contentType: "application/json;charset=utf-8",
                    success: function (data) {
                        if (data.success) {
                            // 当前状态的显示
                            if(row.status){
                                row.statusName = _this.languageType=="zh"?' 启用':'Open';
                                var successMessage1=_this.languageType=="zh"?'启用成功！':'Open Success';
                                _this.common.successTip(successMessage1);
                            }else{
                                row.statusName = _this.languageType=="zh"?' 禁用':'Close';
                                var successMessage2=_this.languageType=="zh"?'禁用成功！':'Close Success';
                                _this.common.successTip(successMessage2);
                            }
                        }else{
                            _this.common.errorTip(data.errorMessage);
                        }
                    }
                });*/
            },
            // 新增
            handleAdd(){
              this.dialogAddVisible=true;
            },
            // 修改弹窗中中的新增
            handleAddAdd(){
                for(var i=0;i<this.addTableData.length;i++){
                    this.addTableData[i].addRowsDisabled=true;
                }
                this.addTableData.unshift({
                    initialQuantity:"",
                    cutOffNumber:"",
                    inspectionQuantity:"",
                    addRowsDisabled:false
                });
            },
            //新增弹窗中的修改
            handleUpdateAdd(index,row){
                row.addRowsDisabled=false;
            },
            //新增弹窗中的删除
            handleDelAdd(index,rows){
                rows.splice(index,1);
            },
            // 修改
            handleUpdate(){
                this.dialogUpdateVisible=true;
            },
            // 修改弹窗中中的新增
            handleAddUpdate(){
                for(var i=0;i<this.updateTableData.length;i++){
                    this.updateTableData[i].updateRowsDisabled=true;
                }
                this.updateTableData.unshift({
                    initialQuantity:"",
                    cutOffNumber:"",
                    inspectionQuantity:"",
                    updateRowsDisabled:false
                });
            },
            //修改弹窗中的修改
            handleUUpdate(index,row){
                row.updateRowsDisabled=false;
            },
            // 修改弹窗中的删除
            handleDelUpdate(index,rows){
                rows.splice(index,1);
            },
            handleSee(){
                this.dialogSeeVisible=true;
            },
            handleSizeChange(){

            },
            handleCurrentChange(){

            },
            
        }
    }
</script>



